# -*- coding: utf-8 -*-
###
# @Author: CPS
# @Date: 2020-07-24 16:10:47
# @Last Modified by:   CPS
# @Last Modified time: 2020-08-20 10:59:02
# @file_path Z:\CPS\MyProject\3176x32 前端\Data\Packages\testt\Testt.py
# @Filename Testt.py
###

import json
import os
import platform
import sublime
import sublime_plugin
from subprocess import Popen, PIPE

# 每次插件加载完都会触发这个函数


def plugin_loaded():
    #print('testt: 加载成功.\n当前系统版本{ver}, 当前系统:{os}'.format(ver=sublime.version(),os=sublime.platform()))
    init()

# 测试函数 [alt + t]


class StylusBeautifyTest(sublime_plugin.TextCommand):

    def run(self, edit):
        print('执行testt')


# 每次打开文件都会触发这个事件
class ExecEventListener(sublime_plugin.EventListener):

    def on_load(self, view):
        print('ExecEventListener(sublime_plugin.EventListener)')

# 初始化函数


def init():
    print('testt: loadSettings 读取配置文件')
    # 载入配置文件
    sett = sublime.load_settings('testtDefault.sublime-settings')

    # 当前插件目录
    shellDir = os.path.join(sublime.packages_path(), 'testt', 'Shell')

    # 用户可以自定义shell的目录,反正里面一定要有 nodejs 或者 python文件夹
    sys.path.append(os.path.join(sublime.packages_path(), 'testt', 'build'))
    import build
    build.updateBuildFile(shellDir)

    # 判断是否有设置
